3.171 \(\int \frac {\tanh ^4(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\)

Optimal. Leaf size=59 \[ \frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} d (a+b)}+\frac {x}{a+b}-\frac {\tanh (c+d x)}{b d} \]

[Out]

x/(a+b)+a^(3/2)*arctan(b^(1/2)*tanh(d*x+c)/a^(1/2))/b^(3/2)/(a+b)/d-tanh(d*x+c)/b/d

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3670, 479, 522, 206, 205} \[ \frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} d (a+b)}+\frac {x}{a+b}-\frac {\tanh (c+d x)}{b d} \]

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]^4/(a + b*Tanh[c + d*x]^2),x]

[Out]

x/(a + b) + (a^(3/2)*ArcTan[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a]])/(b^(3/2)*(a + b)*d) - Tanh[c + d*x]/(b*d)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 479

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e^(2*n
- 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(b*d*(m + n*(p + q) + 1)), x] - Dist[e^(2*n)
/(b*d*(m + n*(p + q) + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1) + (a*d*(m +
 n*(q - 1) + 1) + b*c*(m + n*(p - 1) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p, q}, x] && NeQ[b*c - a*d
, 0] && IGtQ[n, 0] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\tanh ^4(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^4}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=-\frac {\tanh (c+d x)}{b d}+\frac {\operatorname {Subst}\left (\int \frac {a+(-a+b) x^2}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{b d}\\ &=-\frac {\tanh (c+d x)}{b d}+\frac {\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{(a+b) d}+\frac {a^2 \operatorname {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tanh (c+d x)\right )}{b (a+b) d}\\ &=\frac {x}{a+b}+\frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} (a+b) d}-\frac {\tanh (c+d x)}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.20, size = 66, normalized size = 1.12 \[ \frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} d (a+b)}+\frac {c+d x}{d (a+b)}-\frac {\tanh (c+d x)}{b d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c + d*x]^4/(a + b*Tanh[c + d*x]^2),x]

[Out]

(c + d*x)/((a + b)*d) + (a^(3/2)*ArcTan[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a]])/(b^(3/2)*(a + b)*d) - Tanh[c + d*x]/
(b*d)

________________________________________________________________________________________

fricas [B]  time = 0.46, size = 777, normalized size = 13.17 \[ \left [\frac {2 \, b d x \cosh \left (d x + c\right )^{2} + 4 \, b d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + 2 \, b d x \sinh \left (d x + c\right )^{2} + 2 \, b d x + {\left (a \cosh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a \sinh \left (d x + c\right )^{2} + a\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (d x + c\right )^{2} + a^{2} - 6 \, a b + b^{2} + 4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 4 \, {\left ({\left (a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} \sinh \left (d x + c\right )^{2} + a b - b^{2}\right )} \sqrt {-\frac {a}{b}}}{{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b}\right ) + 4 \, a + 4 \, b}{2 \, {\left ({\left (a b + b^{2}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} d \sinh \left (d x + c\right )^{2} + {\left (a b + b^{2}\right )} d\right )}}, \frac {b d x \cosh \left (d x + c\right )^{2} + 2 \, b d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + b d x \sinh \left (d x + c\right )^{2} + b d x + {\left (a \cosh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a \sinh \left (d x + c\right )^{2} + a\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )} \sqrt {\frac {a}{b}}}{2 \, a}\right ) + 2 \, a + 2 \, b}{{\left (a b + b^{2}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} d \sinh \left (d x + c\right )^{2} + {\left (a b + b^{2}\right )} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^4/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

[1/2*(2*b*d*x*cosh(d*x + c)^2 + 4*b*d*x*cosh(d*x + c)*sinh(d*x + c) + 2*b*d*x*sinh(d*x + c)^2 + 2*b*d*x + (a*c
osh(d*x + c)^2 + 2*a*cosh(d*x + c)*sinh(d*x + c) + a*sinh(d*x + c)^2 + a)*sqrt(-a/b)*log(((a^2 + 2*a*b + b^2)*
cosh(d*x + c)^4 + 4*(a^2 + 2*a*b + b^2)*cosh(d*x + c)*sinh(d*x + c)^3 + (a^2 + 2*a*b + b^2)*sinh(d*x + c)^4 +
2*(a^2 - b^2)*cosh(d*x + c)^2 + 2*(3*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^2 + a^2 - b^2)*sinh(d*x + c)^2 + a^2 -
6*a*b + b^2 + 4*((a^2 + 2*a*b + b^2)*cosh(d*x + c)^3 + (a^2 - b^2)*cosh(d*x + c))*sinh(d*x + c) + 4*((a*b + b^
2)*cosh(d*x + c)^2 + 2*(a*b + b^2)*cosh(d*x + c)*sinh(d*x + c) + (a*b + b^2)*sinh(d*x + c)^2 + a*b - b^2)*sqrt
(-a/b))/((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(a -
b)*cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*x + c)^2 + a - b)*sinh(d*x + c)^2 + 4*((a + b)*cosh(d*x + c)^3 + (a -
 b)*cosh(d*x + c))*sinh(d*x + c) + a + b)) + 4*a + 4*b)/((a*b + b^2)*d*cosh(d*x + c)^2 + 2*(a*b + b^2)*d*cosh(
d*x + c)*sinh(d*x + c) + (a*b + b^2)*d*sinh(d*x + c)^2 + (a*b + b^2)*d), (b*d*x*cosh(d*x + c)^2 + 2*b*d*x*cosh
(d*x + c)*sinh(d*x + c) + b*d*x*sinh(d*x + c)^2 + b*d*x + (a*cosh(d*x + c)^2 + 2*a*cosh(d*x + c)*sinh(d*x + c)
 + a*sinh(d*x + c)^2 + a)*sqrt(a/b)*arctan(1/2*((a + b)*cosh(d*x + c)^2 + 2*(a + b)*cosh(d*x + c)*sinh(d*x + c
) + (a + b)*sinh(d*x + c)^2 + a - b)*sqrt(a/b)/a) + 2*a + 2*b)/((a*b + b^2)*d*cosh(d*x + c)^2 + 2*(a*b + b^2)*
d*cosh(d*x + c)*sinh(d*x + c) + (a*b + b^2)*d*sinh(d*x + c)^2 + (a*b + b^2)*d)]

________________________________________________________________________________________

giac [A]  time = 0.23, size = 87, normalized size = 1.47 \[ \frac {\frac {a^{2} \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{{\left (a b + b^{2}\right )} \sqrt {a b}} + \frac {d x + c}{a + b} + \frac {2}{b {\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^4/(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

(a^2*arctan(1/2*(a*e^(2*d*x + 2*c) + b*e^(2*d*x + 2*c) + a - b)/sqrt(a*b))/((a*b + b^2)*sqrt(a*b)) + (d*x + c)
/(a + b) + 2/(b*(e^(2*d*x + 2*c) + 1)))/d

________________________________________________________________________________________

maple [A]  time = 0.10, size = 95, normalized size = 1.61 \[ -\frac {\tanh \left (d x +c \right )}{b d}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{d \left (2 b +2 a \right )}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{d \left (2 b +2 a \right )}+\frac {a^{2} \arctan \left (\frac {\tanh \left (d x +c \right ) b}{\sqrt {a b}}\right )}{d b \left (a +b \right ) \sqrt {a b}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)^4/(a+b*tanh(d*x+c)^2),x)

[Out]

-tanh(d*x+c)/b/d-1/d/(2*b+2*a)*ln(tanh(d*x+c)-1)+1/d/(2*b+2*a)*ln(1+tanh(d*x+c))+1/d/b/(a+b)*a^2/(a*b)^(1/2)*a
rctan(tanh(d*x+c)*b/(a*b)^(1/2))

________________________________________________________________________________________

maxima [B]  time = 0.60, size = 509, normalized size = 8.63 \[ -\frac {{\left (a - b\right )} \log \left ({\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a - b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{8 \, {\left (a b + b^{2}\right )} d} + \frac {{\left (a - b\right )} \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{8 \, {\left (a b + b^{2}\right )} d} + \frac {{\left (a^{2} - 6 \, a b + b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{16 \, {\left (a b + b^{2}\right )} \sqrt {a b} d} + \frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, \sqrt {a b} b d} - \frac {{\left (a^{2} - 6 \, a b + b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{16 \, {\left (a b + b^{2}\right )} \sqrt {a b} d} - \frac {3 \, {\left (a + b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{8 \, \sqrt {a b} b d} - \frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, \sqrt {a b} b d} - \frac {\log \left ({\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a - b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{4 \, b d} + \frac {\log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{4 \, b d} + \frac {3 \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{4 \, b d} - \frac {3 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{4 \, b d} + \frac {5}{8 \, {\left (b e^{\left (2 \, d x + 2 \, c\right )} + b\right )} d} - \frac {11}{8 \, {\left (b e^{\left (-2 \, d x - 2 \, c\right )} + b\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^4/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/8*(a - b)*log((a + b)*e^(4*d*x + 4*c) + 2*(a - b)*e^(2*d*x + 2*c) + a + b)/((a*b + b^2)*d) + 1/8*(a - b)*lo
g(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/((a*b + b^2)*d) + 1/16*(a^2 - 6*a*b + b^2)*ar
ctan(1/2*((a + b)*e^(2*d*x + 2*c) + a - b)/sqrt(a*b))/((a*b + b^2)*sqrt(a*b)*d) + 1/4*(a - b)*arctan(1/2*((a +
 b)*e^(2*d*x + 2*c) + a - b)/sqrt(a*b))/(sqrt(a*b)*b*d) - 1/16*(a^2 - 6*a*b + b^2)*arctan(1/2*((a + b)*e^(-2*d
*x - 2*c) + a - b)/sqrt(a*b))/((a*b + b^2)*sqrt(a*b)*d) - 3/8*(a + b)*arctan(1/2*((a + b)*e^(-2*d*x - 2*c) + a
 - b)/sqrt(a*b))/(sqrt(a*b)*b*d) - 1/4*(a - b)*arctan(1/2*((a + b)*e^(-2*d*x - 2*c) + a - b)/sqrt(a*b))/(sqrt(
a*b)*b*d) - 1/4*log((a + b)*e^(4*d*x + 4*c) + 2*(a - b)*e^(2*d*x + 2*c) + a + b)/(b*d) + 1/4*log(2*(a - b)*e^(
-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/(b*d) + 3/4*log(e^(2*d*x + 2*c) + 1)/(b*d) - 3/4*log(e^(-2*d
*x - 2*c) + 1)/(b*d) + 5/8/((b*e^(2*d*x + 2*c) + b)*d) - 11/8/((b*e^(-2*d*x - 2*c) + b)*d)

________________________________________________________________________________________

mupad [B]  time = 1.23, size = 56, normalized size = 0.95 \[ \frac {x}{a+b}-\frac {\mathrm {tanh}\left (c+d\,x\right )}{b\,d}+\frac {a^2\,\mathrm {atan}\left (\frac {b\,\mathrm {tanh}\left (c+d\,x\right )}{\sqrt {a\,b}}\right )}{b\,d\,\sqrt {a\,b}\,\left (a+b\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(c + d*x)^4/(a + b*tanh(c + d*x)^2),x)

[Out]

x/(a + b) - tanh(c + d*x)/(b*d) + (a^2*atan((b*tanh(c + d*x))/(a*b)^(1/2)))/(b*d*(a*b)^(1/2)*(a + b))

________________________________________________________________________________________

sympy [A]  time = 11.28, size = 495, normalized size = 8.39 \[ \begin {cases} \tilde {\infty } x \tanh ^{2}{\relax (c )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {\tanh {\left (c + d x \right )}}{d}}{a} & \text {for}\: b = 0 \\\frac {x - \frac {\tanh {\left (c + d x \right )}}{d}}{b} & \text {for}\: a = 0 \\\frac {3 d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {3 d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 \tanh ^{3}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {3 \tanh {\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x \tanh ^{4}{\relax (c )}}{a + b \tanh ^{2}{\relax (c )}} & \text {for}\: d = 0 \\- \frac {2 i a^{\frac {3}{2}} b \sqrt {\frac {1}{b}} \tanh {\left (c + d x \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} + \frac {2 i \sqrt {a} b^{2} d x \sqrt {\frac {1}{b}}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} - \frac {2 i \sqrt {a} b^{2} \sqrt {\frac {1}{b}} \tanh {\left (c + d x \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} + \frac {a^{2} \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} - \frac {a^{2} \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)**4/(a+b*tanh(d*x+c)**2),x)

[Out]

Piecewise((zoo*x*tanh(c)**2, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), ((x - tanh(c + d*x)**3/(3*d) - tanh(c + d*x)/d)/
a, Eq(b, 0)), ((x - tanh(c + d*x)/d)/b, Eq(a, 0)), (3*d*x*tanh(c + d*x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*d) -
3*d*x/(2*b*d*tanh(c + d*x)**2 - 2*b*d) - 2*tanh(c + d*x)**3/(2*b*d*tanh(c + d*x)**2 - 2*b*d) + 3*tanh(c + d*x)
/(2*b*d*tanh(c + d*x)**2 - 2*b*d), Eq(a, -b)), (x*tanh(c)**4/(a + b*tanh(c)**2), Eq(d, 0)), (-2*I*a**(3/2)*b*s
qrt(1/b)*tanh(c + d*x)/(2*I*a**(3/2)*b**2*d*sqrt(1/b) + 2*I*sqrt(a)*b**3*d*sqrt(1/b)) + 2*I*sqrt(a)*b**2*d*x*s
qrt(1/b)/(2*I*a**(3/2)*b**2*d*sqrt(1/b) + 2*I*sqrt(a)*b**3*d*sqrt(1/b)) - 2*I*sqrt(a)*b**2*sqrt(1/b)*tanh(c +
d*x)/(2*I*a**(3/2)*b**2*d*sqrt(1/b) + 2*I*sqrt(a)*b**3*d*sqrt(1/b)) + a**2*log(-I*sqrt(a)*sqrt(1/b) + tanh(c +
 d*x))/(2*I*a**(3/2)*b**2*d*sqrt(1/b) + 2*I*sqrt(a)*b**3*d*sqrt(1/b)) - a**2*log(I*sqrt(a)*sqrt(1/b) + tanh(c
+ d*x))/(2*I*a**(3/2)*b**2*d*sqrt(1/b) + 2*I*sqrt(a)*b**3*d*sqrt(1/b)), True))

________________________________________________________________________________________